const ctrl = ['$scope', '$stateParams', '$http', 'locals', 'prism', function ($scope, $stateParams, $http, locals, prism) {
    prism.prism();
    // 获取url的参数
    $scope.num = $stateParams.id;
    // 进行一次http-get请求
    $http({
        method: 'GET',
        url: `https://jsonplaceholder.typicode.com/posts?userId=1`
    }).then(
        // 将所得数据res传给局部变量$scope.res，html中可以用ng-repeat渲染。
        res => {
            $scope.res = res.data;
        }
    )
}]

export default ctrl;